package com.beta.elephant.dto;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * 分页查询基础结构类
 *
 * @author kevin_zhang
 */
public class BasePageDTO implements Serializable {
    @ApiModelProperty(value = "第几页，默认第一页", required = false)
    public int pageNo = 1;
    @ApiModelProperty(value = "每页显示多少条数据，默认10条数据", required = false)
    public int pageSize = 10;

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public BasePageDTO() {
    }

    public BasePageDTO(int pageNo, int pageSize) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
    }

    public int getLimitStart() {
        return ((pageNo - 1) * pageSize);
    }
}
